package com.uni.support.em;

public enum OrderStatus {
	UNPAID(0,"未付款"),
	PAID(1,"已付款"),
	MERCHANTRECEIVED(2,"商家已接单"),
	PUBLISH(3,"订单发布中"),
	
	RECEIVED(4,"已接单"),
	DELIVERY(5,"派送中"),
	ARRIVED(6,"已送达"),
	CONFIRM(7,"确认送达"),
	REFUNDING(8,"退款中"),
	REFUNDSUCCESS(9,"退款成功"),
	REFUNDFAIL(10,"退款失败"),
	
	CANCEL(80,"已取消"),
	;
	
	private int status;
	private String desc;
	
	private OrderStatus(int status,String desc) {
		this.status = status;
		this.desc = desc;
	}
	
	public static OrderStatus getByType(int status) {
		for(OrderStatus aoo : OrderStatus.values()) {
			if(aoo.status == status) {
				return aoo;
			}
		}
		return null;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
